
		window.onload = function() {
		    //配置
		    var config = {
		        vx: 4,	//小球x轴速度,正为右，负为左
		        vy: 4,	//小球y轴速度
		        height: 2,	//小球高宽，其实为正方形，所以不宜太大
		        width: 2,
		        count: 200,		//点个数
		        color: "grey", 	//点颜色
		        stroke: "grey", 		//线条颜色
		        dist: 6000, 	//点吸附距离
		        e_dist: 20000, 	//鼠标吸附加速距离
		        max_conn: 10 	//点到点最大连接数
		    }

		    //调用
		    CanvasParticle(config);
        }
        let data = [
      {"count": 4000, "price": 1200, "unitPrice": "0.3000"},
      {"count": 8000, "price": 2000,"unitPrice": "0.2500" },
      {"count": 40000, "price": 8000, "unitPrice": "0.2000" }
     ]
     let pricelist = "";
     data.forEach(function(v,i){
         pricelist+=`
         <div class = "${i === 0 ? "active":""}" data-price=${v.price} data-unit-price = "${v.unitPrice}">${v.count}次</div>
         `
     })
    $('.listprice').innerHTML = pricelist;

    $('.listprice').addEventListener('click',function(e){
        let a = e.target
        if (e.target.nodeName === "DIV") {
            [...$('.listprice').children].forEach(function(v){
                v.classList.remove('active')
            });
            e.target.classList.add('active')
            // console.log(a.dataset.price);
            // console.log(a.dataset.unitPrice);
            $('.span1').textContent = a.dataset.price;
            $('.span2').textContent = a.dataset.unitPrice
            
        }
    })
    //选项卡
     let li = document.querySelectorAll('.menu li')//关联标签
        let div = document.querySelectorAll('.neirong11')
        console.log(div);
        
        li.forEach(function(a,b){//遍历菜单，赋值当前元素给a,b为索引
            a.addEventListener('mouseover',function(){//添加鼠标移入当前元素事件
                // console.log(1);
                li.forEach(function(v,i){//遍历后为菜单和索引i对应的p移除class样式
                    v.classList = ''
                    div[i].classList.remove('on')
                })
                this.className = 'active'//再添加样式给当前的菜单和内容
                div[b].classList.add('on')
                
            })
        })